package top.wangjingxin.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import top.wangjingxin.base.Result;
import top.wangjingxin.model.link.RotationVO;
import top.wangjingxin.service.RotationService;

@RequestMapping("/api/v1/rotation")
@RestController
public class RotationController {
    @Autowired
    RotationService rotationService;

    @GetMapping("get")
    public Result get() {
        return rotationService.get();
    }

    @PostMapping("delete")
    public Result delete(String id) {
        return rotationService.delete(id);
    }

    @PostMapping("add")
    public Result add(MultipartFile file, RotationVO rotationVO) {
        return rotationService.add(file,rotationVO);
    }
}
